import request from '@/utils/request.js'

// 登录接口
export const login = (data) => {
  return request({
    url: '/login',
    method: 'POST',
    data
  })
}
// 最后登录时间

// 修改密码
export const updateUser = (password, token) => {
  return request({
    url: `/modifyPassWord?password=` + password + `&token=` + token,
    method: 'POST'
  })
}

// 忘记密码--发送验证码
export const getCode = (phoneNumber) => {
  return request({
    url: `/getCode?phoneNumber=` + phoneNumber,
    method: 'GET'
  })
}

// 忘记密码--校验验证码
export const verifyCode = (code, phoneNumber) => {
  return request({
    url: `/verify?code=` + code + `&phoneNumber=` + phoneNumber,
    method: 'GET'
  })
}

// 忘记密码--修改密码
export const forgetPassWordCode = (data) => {
  return request({
    url: '/forgetPassWord',
    method: 'POST',
    data
  })
}

// 修改个人信息
export const PersonalInformation = (data) => {
  return request({
    url: '/update',
    method: 'PUT',
    data
  })
}

// 检查是否绑定
export const checkBindCode = (data) => {
  return request({
    url: '/checkBind',
    method: 'POST',
    data
  })
}

// 二维码
export const getLoginQRImage = (data) => {
  return request({
    url: '/getLoginQRImage',
    method: 'GET',
    data
  })
}
// 获取个人身份
export const getUnitInformationOptions = (data) => {
  return request({
    url: '',
    method: 'GET',
    data
  })
}

// 绑定二维码
export const getUserQRImage = (userPhone) => {
  return request({
    url: '/getBindQRImage?userPhone=' + userPhone,
    method: 'GET'
  })
}

// 检查是否已经扫码登录
export const checkLoginCode = (data) => {
  return request({
    url: '/checkLogin',
    method: 'POST',
    data
  })
}

// 选择的登录
export const loginUser = (data) => {
  return request({
    url: '/loginUser1',
    method: 'POST',
    data
  })
}

// 订单查询
export const orderInfoMember = (data) => {
  return request({
    url: '/orderInfo/list',
    method: 'GET',
    data
  })
}

// VIP商品管理
export const commodityManagement = (data) => {
  return request({
    url: '/system/vipsetup/list',
    method: 'GET',
    data
  })
}

// 支付二维码
export const payment = (data) => {
  return request({
    url: '/pay/native',
    method: 'POST',
    data
  })
}

//下单会员
export const paymentStatus = (orderNo) => {
  return request({
    url: '/pay/wxpay/notifyBoolean?orderNo=' + orderNo,
    method: 'POST'
  })
}
// 取消订单
export const cancelOrder = (orderNo) => {
  return request({
    url: '/orderInfo/close/' + orderNo,
    method: 'POST'
  })
}
